css content from data attribute

40

div { 
	content: attr(id); /* Get content from the ID */
	content: attr(class); /* Get content from the class attribute */
  	content: attr(data-custom); /* Get content from a custom attribute, e.g. <div data-custom="My Content">*/
}

Comments

Submit
0 Comments